#ifndef PAGE_VIDEO_H
#define PAGE_VIDEO_H

#include <QWidget>

#include <QtNetwork/QUdpSocket>
#include "udpthread.h"
#include "bigimage.h"
#include "clickeventfilter.h"
#include "getvideothread.h"

/* 使用命名空间cv下的VideoCapture与Mat类 */
namespace cv {
class VideoCapture;
class Mat;
}

namespace Ui {
class Page_video;
}

class Page_video : public QWidget
{
    Q_OBJECT

public:
    explicit Page_video(QWidget *parent = nullptr);
    ~Page_video();

    void showImage(const QImage &image);
    void readPendingDatagrams();
    void showImg(QImage *image);
public slots:
    void handleClicked_left();
    void handleClicked_right();

    void showImg_left(QImage *image);
signals:
    void backToMainPage();

private slots:
    void on_pBtn_back_clicked();

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

private:
    Ui::Page_video *ui;
    QImage m_saveImage;
    QUdpSocket *m_udpSocket;
    UdpThread *m_udpThread;


    BigImage *m_bigimage;
    bool m_leftisBig;
    bool m_rightisBig;

    GetVideoThread *m_getVideoThread;


};

#endif // PAGE_VIDEO_H
